package com.hgvip.mapper;

import com.hgvip.entity.User;
import org.springframework.cache.annotation.CacheConfig;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Cacheable;

import java.util.List;

/**
 * Created by arnold.zhu on 6/14/2017.
 */
@CacheConfig(cacheNames = "usersInfo")
public interface UserMapper {

    @Cacheable(key = "'users'")
    List<User> getUsers();

    @CacheEvict(key = "'users'")
    int addUser(User user);
}
